using System;
using System.Collections.Generic;
using System.Text;
using Bifrost;
using TextEditor.TextDocument.frmWindow;
using TextEditor.TextDocument.Control;

namespace TextEditor
{
    public class A_InsertDiagnose : A_Action
    {
        public A_InsertDiagnose()
        {
            base.HotKey = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D;
        }

        public override string ActionName()
        {
            return "diagnose";
        }

        public override bool Execute()
        {
            UIExecute();
            return true;
        }

        public override bool UIExecute()
        {
            //if (base.myOwnerDocument.Us.InpatientInfo != null)
            //{
            //    //frDiagnose fr = new frDiagnose(base.myOwnerDocument);
            //    //App.FormStytleSet(fr, false);
            //    frmDiagnoseModify fr = new frmDiagnoseModify(base.myOwnerDocument);
            //    fr.ShowDialog();
            //    return true;
            //}
            frmDiagnoseSimple fd = new frmDiagnoseSimple(this.OwnerDocument);
            fd.ShowDialog();
            return true;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify() && base.myOwnerDocument.Us.InpatientInfo != null;
        }
    }
}
